package net.wofly.sale.shoppingcart.service;


import net.wofly.sale.shoppingcart.entity.CartList;

import java.util.List;

public interface ICartListService {

	/**
	 * 增加或修改
	 * 
	 * @param entity
	 * @return
	 */
	CartList save(CartList entity);

	/**
	 * 删除
	 * 
	 * @param entity
	 * @return
	 */
	void delete(CartList entity);

	/**
	 * 根据主键ID删除
	 * 
	 * @param key
	 * @return
	 */
	void delete(String key);

	/**
	 * 根据主键查询
	 * 
	 * @param key
	 * @return
	 */
	CartList findOne(String key);
	
	List<CartList> save(List<CartList> entityList) ;

	CartList findByShoppingCartIDAndCommodityID(String userID, String commodityID);
	
	CartList findByShoppingCartIDAndCommodityID(String userID, Integer shoppingCartType, String commodityID);

	List<CartList> findByShoppingCartID(String userID);
	
	List<CartList> findByShoppingCartID(String userID, Integer shoppingCartType);
	
	void  deleteByShoppingCartID(String cartListID);
	
	void  deleteByShoppingCartIDAndShoppingCartType(String cartListID, Integer shoppingCartType);
}
